/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #333;
}

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-bar {
    background-color: #f2f2f2;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #e4393c;
}

.search-box {
    display: flex;
    width: 50%;
}

.search-box input {
    width: 80%;
    padding: 10px;
    border: 2px solid #e4393c;
    border-right: none;
}

.search-box button {
    width: 20%;
    background-color: #e4393c;
    color: white;
    border: none;
    cursor: pointer;
}

.cart-icon a {
    display: flex;
    align-items: center;
    color: #666;
}

/* 导航栏 */
nav ul {
    display: flex;
    list-style: none;
    background-color: #e4393c;
}

nav ul li a {
    display: block;
    padding: 15px 20px;
    color: white;
}

nav ul li a:hover {
    background-color: #c91623;
}

/* 轮播图容器 */
.slider {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

/* 图片容器 */
.slides {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 图片样式 */
.slides img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* 控制点样式 */
.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.slider-controls span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.slider-controls span.active {
    background-color: white;
}

/* 商品分类 */
.category {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
}

.category h2 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    border: 1px solid #eee;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .price {
    color: #e4393c;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-card .add-to-cart {
    background-color: #e4393c;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
}

.product-card .add-to-cart:hover {
    background-color: #c91623;
}

/* 页脚 */
footer {
    background-color: #fff;
    padding: 30px 0 10px;
}

.footer-links {
    display: flex;
    justify-content: space-around;
    padding: 0 20px 20px;
    border-bottom: 1px solid #eee;
}

.links-column h4 {
    margin-bottom: 15px;
    font-size: 16px;
}

.links-column ul {
    list-style: none;
}

.links-column ul li {
    margin-bottom: 8px;
}

.links-column ul li a {
    color: #666;
    font-size: 14px;
}

.links-column ul li a:hover {
    color: #e4393c;
}

.copyright {
    text-align: center;
    padding: 20px 0;
    color: #999;
    font-size: 12px;
}

/* 购物车页面 */
.cart-page {
    padding: 20px;
    background-color: #f5f5f5;
}

.cart-container {
    display: flex;
    gap: 20px;
}

.cart-items {
    flex: 3;
    background-color: white;
    padding: 20px;
}

.cart-summary {
    flex: 1;
    background-color: white;
    padding: 20px;
    height: fit-content;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background-color: #f9f9f9;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.summary-row.total {
    font-weight: bold;
    font-size: 18px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.checkout-button {
    width: 100%;
    padding: 12px;
    background-color: #e4393c;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.checkout-button:hover {
    background-color: #c91623;
}